using UnityEngine;
using System.Collections;


public class AlertUIHandler : WinHandler< AlertUIHandler >
{
	public delegate void onHandler();

	private onHandler onOK = null;
	private onHandler onCancel = null;
	
	void Awake ()
	{
		mInstance = this;
		
	}
	
	public override void onRelease()
	{
		
	}
	public override void onInit()
	{
		
	}
	public override void onOpen()
	{
		base.onOpen ();
	}
	public override void onClose()
	{
		
	}

	public void AlertLocal( string str , onHandler ok = null , onHandler cancel = null )
	{
		string str1 = Localization.Get( str );

		onOK = ok;
		onCancel = cancel;
	}

	public void Alert( string str , onHandler ok = null , onHandler cancel = null )
	{
		onOK = ok;
		onCancel = cancel;
	}

	public void onOKClick()
	{
		if ( onOK != null )
		{
			onOK();
		}
	}

	public void onCancelClick()
	{
		if ( onCancel != null )
		{
			onCancel();
		}
	}


	// Use this for initialization
	void Start () 
	{
		//Show();
	}
	
	
	// Update is called once per frame
	void Update () 
	{
		
	}
}
